package org.jeecg.board.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.board.dto.LineBoardBarDTO;

import java.util.List;
import java.util.Map;

/**
 * &#064;Description
 * &#064;Author  LiCY
 * &#064;Date  2023/4/25
 */
@Mapper
public interface LineBoardMapper {
    /**
     * 计算工站一次合格率
     */
    List<LineBoardBarDTO> getStnFTQ(@Param("param") Map<String, Object> map);

    /**
     * 计算工站OEE
     *
     * @param map
     * @return
     */
    List<LineBoardBarDTO> getStnOEE(@Param("param") Map<String, Object> map);

    /**
     * 计算产线各工站时间稼动率
     */
    List<LineBoardBarDTO> getAvailability(@Param("param") Map<String, Object> map);

    /**
     * 计算产线各工站性能稼动率
     */
    List<LineBoardBarDTO> getPerformance(@Param("param") Map<String, Object> map);

    /**
     * 计算当日产线生产总数
     */
    Double getTotalNum(@Param("param") Map<String, Object> map);

    /**
     * 计算当日产线不合格总数
     */
    Double getNGNum(@Param("param") Map<String, Object> map);

    /**
     * 计算工单合格率
     */
    Double getWoPassRate(@Param("param") Map<String, Object> map);

    /**
     * 计算工单合格率
     */
    Integer getWoErrorNum(@Param("param") Map<String, Object> map);

    /**
     * 计算指定工站总生产数
     * @param map
     * @return
     */
    Integer getOpTotalNum(@Param("param") Map<String, Object> map,@Param("list") List<String> opList);

    /**
     * 计算指定工站不合格数
     * @param map
     * @return
     */
    List<String> getOpErrorNum(@Param("param") Map<String, Object> map,@Param("list") List<String> opList);

    List<String> getTimeList(@Param("param") Map<String, Object> param);
    @InterceptorIgnore(tenantLine ="true")
    List<Integer> getPlanNum(@Param("param") Map<String, Object> param);
    @InterceptorIgnore(tenantLine ="true")
    List<Integer> getActualNum(@Param("param") Map<String, Object> param);

    Double getTodayDowntime(@Param("param") Map<String, Object> param);

    Double getLineAvailability(@Param("param") Map<String, Object> param);

    Double getLinePerformance(@Param("param") Map<String, Object> param);

    Double getTodayQualifiedNum(@Param("param") Map<String, Object> param);

    Double getTodayUnqualifiedNum(@Param("param") Map<String, Object> param);

    List<LineBoardBarDTO> getUnqualifiedCause(@Param("param") Map<String, Object> param);

    List<LineBoardBarDTO> getAlarmDuration(@Param("param") Map<String, Object> param);

    List<LineBoardBarDTO> getAlarmNum(@Param("param") Map<String, Object> param);

    Integer getWoidNum(@Param("param") Map<String, Object> param);

    /**
     * 求班组理论小时累计生产数
     */
    @InterceptorIgnore(tenantLine ="true")
    List<String> getClassPlanTotalNum(@Param("param") Map<String, Object> param);


    /**
     * 求班组理论小时累计生产数
     */
    @InterceptorIgnore(tenantLine ="true")
    List<String> getClassAlarmTotalNum(@Param("param") Map<String, Object> param);
    @InterceptorIgnore(tenantLine ="true")
    List<String> getClassTimeList(@Param("param") Map<String, Object> param);

    List<Integer> getOpPassRate(@Param("param") Map<String, Object> param,@Param("op")String op);

    List<String> getLineOPList(@Param("param") Map<String, Object> param);

    List<Double> getLineOPRunList(@Param("param") Map<String, Object> param);

    List<String> getLineOPStopList(@Param("param") Map<String, Object> param);

    Integer getProductBeat(@Param("param") Map<String, Object> param);
}
